package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.info.InvestorInfo;
import com.sphd.beautysalon.info.InvestorItemInfo;
import com.sphd.beautysalon.model.AccountDetailModelImpl;
import com.sphd.beautysalon.view.AccountDetailView;

import java.util.List;

/**
 * Created by Hu on 2016/11/03
 */

public class AccountDetailPresenterImpl implements AccountDetailPresenter {
    private AccountDetailModelImpl accountDetailModel;
    private AccountDetailView accountDetailView;

    public AccountDetailPresenterImpl(AccountDetailView accountDetailView) {
        accountDetailModel=new AccountDetailModelImpl();
        this.accountDetailView = accountDetailView;
    }

    @Override
    public void addData(String url) {
        accountDetailView.showLoading();
        accountDetailModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        accountDetailView.dissLoading();
    }

    @Override
    public void sendRes(double all_interest, List<InvestorItemInfo> investorItemInfos, List<InvestorInfo> investorInfoList) {
        accountDetailView.setmCutMoney(all_interest);
        accountDetailView.setMoney(investorInfoList);
        accountDetailView.rfAdapter(investorItemInfos);
        accountDetailView.dissLoading();
    }
}